/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package desarrollosoft.ghce.dao.implementaciones;

import desarrollosoft.ghce.dao.interfaces.ISexoDAO;
import desarrollosoft.ghce.entidades.Sexo;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.stereotype.Repository;

/**
 *
 * @author ariel
 */
@Repository("sexoDAO")
public class SexoDAO implements ISexoDAO {
    
    @PersistenceContext
    EntityManager entityManager;

    @Override
    public List<Sexo> obtenerTodosSexo() {
        Query q = entityManager.createQuery("SELECT s FROM Sexo s ORDER BY s.nombre ASC");
        return q.getResultList();
    }
    
    
}
